1. Technical Field
The present invention relates to data processing in general, and, in particular, to a method for controlling rounding modes. Still more particularly, the present invention relates to a method for controlling rounding modes in single instruction multiple data (SIMD) floating-point units.
2. Description of Related Art
Generally speaking, a rounding mode is used to control the rounding of floating-point numbers during a floating-point operation within a floating-point data processing system. During the course of a scientific computation, the rounding mode tends to be switched very often. However, the frequent switching of the rounding mode creates a significant problem that can be attributed to a drawback of common processor designs. That is, every time when a processor switches its rounding mode, the processor has to flush its internal pipelines. Thus, the processor suffers a severe performance penalty whenever the processor is required to switch its rounding mode.
Many mathematical or scientific computations require the rounding mode to be switched on a frequent basis. For example, rounding mode switching occurs repeatedly in interval arithmetic when the same computations are performed twice, once with a round-up mode and the other with a round-down mode. The result of the interval arithmetic is an interval [a,b] where the infinitely precise result of the computation problem (which cannot be precisely computed) is guaranteed to lie within that interval. Thus, in order for a processor to perform the same computations according to the two different rounding modes, the processor has to change its rounding mode frequently.
Consequently, it would be desirable to provide an improved apparatus for controlling rounding modes such that the above-mentioned problem can be alleviated.